package com.example.boot7httpactuator.controller;

import com.example.boot7httpactuator.bean.ConsultConfigArea;
import com.example.boot7httpactuator.service.AreaService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

@RestController
public class TestSwaggerContoroller {


    @Autowired
    AreaService areaService;


    @ApiOperation("查询地区接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", value = "地区编码")
    })
    @RequestMapping("/queryArea")
    public @ResponseBody String queryArea(String param) {
        List<ConsultConfigArea> areas = areaService.qryArea(new HashMap());
        for (ConsultConfigArea area : areas) {
            System.out.println(area.getAreaCode() + "   " + area.getAreaName() + "   "
                    + area.getState());
        }
        return "OK";
    }
}
